package com.atwisdom.star.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName: WebConfig
 * @ Description:
 * @author:王红艳
 * @date:
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Value("${filePath}")
    private String fileSavePath;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        /**
         * 配置资源映射
         */
        registry.addResourceHandler("/FILE/**")
                .addResourceLocations("file:"+fileSavePath);
    }
}
